package com.atguigui.leetcode;

/**
 * 1598.文件夹操作日志搜集器
 * Project: leetcode
 * Package: com.atguigui.leetcode
 * Version: 1.0
 * <p>
 * Created by WJX on 2022/9/9 9:00
 */
public class P1598CrawlerLogFolder {

    public static void main(String[] args) {
//        Solution solution = new P1598CrawlerLogFolder().new Solution();
        // TO TEST

//        String str = "../";
//        String[] split = str.split("\\/");
//        System.out.println(split.length);
//        int index = split[0].indexOf(".");
//        System.out.println(index);


        String sn = "00-00-00";
        String replace = sn.replace("-", "_");
        System.out.println(sn);
        System.out.println(replace);

    }

    class Solution {
        public int minOperations(String[] logs) {
            int ans = 0;
            for (String log : logs) {
                String[] split = log.split("\\/");

                int index = 0;
                int sum = 0;
                //判断有多少个 "."
                while (split[0].indexOf(".", index) >= 0) {
                    index++;
                    sum++;
                }
                if (sum == 0) {
                    ans++;
                } else if (sum == 2 && ans > 0) {
                    ans--;
                }
            }
            return ans;
        }
    }
}
